<?php
	if(isset($addProductSuccess) && !$addProductSuccess)
	{
		echo renderAlertControl('danger','Add Product Failed','Adding the new product failed please try again');
	}
?>
<div class="panel panel-primary">
	<!-- Default panel contents -->
	<div class="panel-heading">Add Product</div>
	<div class="panel-body">
		<form method="POST" role="form" action="products.php" id="add-product-form" name="addproduct" enctype="multipart/form-data">

			<hr size="1" class="post-body-seperator" style="color:#e2e1ea">			
			
			<div>
				<div class="form-group">
					<label for="txtStreet1">Name</label>
					<div class="input-group input-group-sm">
						<span class="input-group-addon">
							<i class="glyphicon glyphicon-book"></i>
						</span>	
						<input type="text" name="txtProductName" id="txtProductName" placeholder="Product Name" maxlength="100" class="form-control input-sm span4" value="<?php if(isset($txtProductName) && !empty($txtProductName)){echo $txtProductName;} ?>" />
					</div>
				</div>
			</div>
			
			<div>
				<div class="form-group">
					<label for="txtStreet2">Brand</label>
					<div class="input-group input-group-sm">
						<span class="input-group-addon">
							<i class="glyphicon glyphicon-book"></i>
						</span>	
						<input type="text" name="txtProductBrand" id="txtProductBrand" placeholder="Product Brand" maxlength="100" class="form-control input-sm span4" value="<?php if(isset($txtProductBrand) && !empty($txtProductBrand)){echo $txtProductBrand;} ?>"/>
					</div>
				</div>
			</div>
			
			<div>
				<div class="form-group">
					<label for="txtCity">Model</label>
					<div class="input-group input-group-sm">
						<span class="input-group-addon">
							<i class="glyphicon glyphicon-book"></i>
						</span>	
						<input type="text" name="txtProductModel" id="txtProductModel" placeholder="Product Model" maxlength="100" class="form-control input-sm span4" value="<?php if(isset($txtProductModel) && !empty($textProductModel)){echo $textProductModel;} ?>" />
					</div>
				</div>
			</div>

			<hr size="1" class="post-body-seperator" style="color:#e2e1ea">
			
			<div>
				<div class="form-group">
					<label>Serial No</label>
					<div class="input-group input-group-sm">
						<span class="input-group-addon">
							<i class="glyphicon glyphicon-barcode"></i>
						</span>	
						<input type="text" class="form-control input-sm span4" name="txtProductSerialNo" placeholder="Product Serial No." id ="txtProductSerialNo" maxlength="30"  value="<?php if(isset($txtProductSerialNo) && !empty($txtProductSerialNo)){echo $txtProductSerialNo;} ?>" />
					</div>
				</div>
			</div>
			
			<div>
				<div class="form-group">					
					<label for="txtProductDescription">Description</label>
					<div class="input-group">
						<span class="input-group-addon">
							<i class="glyphicon glyphicon-list-alt"></i>
						</span>
						<textarea rows="10" cols="75" class="form-control input-sm span6" name="txtProductDescription" id="txtDescription" size="255" placeholder="Tell TicToc Watches about your product..."><?php if(isset($txtProductDescription) && !empty($txtProductDescription)){echo $txtProductDescription;} ?></textarea>
					</div>
				</div>
			</div>
			
			<hr size="1" class="post-body-seperator" style="color:#e2e1ea">
			
			<div>
				<div class="form-group">
					<label>Amount In Stock</label>
					<div class="input-group input-group-sm">
						<span class="input-group-addon">
							<i class="glyphicon glyphicon-tasks"></i>
						</span>	
						<input type="text" class="form-control input-sm span4" name="txtProductAmountInStock" id ="txtProductAmountInStock" maxlength="18" placeholder="How many is in stock?"  value="<?php if(isset($txtProductAmountInStock) && !empty($txtProductAmountInStock)){echo $txtProductAmountInStock;} ?>" />
					</div>
				</div>
			</div>
			
			<div>
				<div class="form-group">
					<label>Unit Price</label>
					<div class="input-group input-group-sm">
						<span class="input-group-addon">
							<i class="glyphicon glyphicon-usd"></i>
						</span>	
						<input type="text" class="form-control input-sm span4" name="txtProductUnitPrice" id ="txtProductUnitPrice" maxlength="18" placeholder="Product Unit Price"  value="<?php if(isset($txtProductUnitPrice) && !empty($txtProductUnitPrice)){echo $txtProductUnitPrice;} ?>" />
					</div>
				</div>
			</div>
		
			<hr size="1" class="post-body-seperator" style="color:#e2e1ea">
			<!--
			<div class="standard-profile-img-container">
				<img class="standard-profile-img" src="img/product/<?php //if(empty($newFilename)){echo("noproduct.gif");}else{echo($newFileName);};?>"/>
			</div>
			-->
			<div>
				<div class="form-group">
					<label for="fileProductImg">Upload the Product Image</label>
					<div class="input-group input-group-sm">
						<span class="input-group-addon">
							<i class="glyphicon glyphicon-camera"></i>
						</span>	
						<input type="file" name="fileProductImg" class="span4 form-control input-sm" id="fileProductImg" placeholder="" maxlength="" />
						
					</div>
					<label for="fileProfileImg" class="error"><?php if(isset($productImgUploadSuccess) && !$productImgUploadSuccess){echo("File upload failed");} ?></label>
				</div>
			</div>	

			
			<div class="form-group">
				<div>
					<input type="submit" class="btn btn-primary" name="btnAddProduct" value="Add">
				</div>
			</div>
			
		</form>
	</div>
</div>